﻿namespace UnitTests.Domain
{
	using System;
	using System.Collections.Generic;
	using System.Linq;
	using Core.Domain;

	internal class StubAccountRepository : IAccountRepository
	{
		private readonly IList<Account> storage = new List<Account>();

		public IList<Account> Storage
		{
			get
			{
				return this.storage;
			}
		}

		public Account GetByEmail(string email)
		{
			throw new NotImplementedException();
		}

		public IEnumerable<Account> EnumerateAccounts()
		{
			throw new NotImplementedException();
		}

		public bool ContainsWithEmail(string email)
		{
			return this.Storage.Any(a => a.Person.EmailAddress == email);
		}

		public void Save(Account account)
		{
			this.Storage.Add(account);
		}
	}
}
